package com.itheima.wemedia.fagin;

import com.itheima.common.vo.ResultVo;
import com.itheima.wemedia.pojo.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "leadnews-wemedia",contextId = "wmUserFagin")
public interface WmUserFagin {
    /**
     * 远程调用查询自媒体数据库
     * @param apiUserId 接收远程调用的id
     * @return 返回查询到的数据给远程调用的方法
     */
    @GetMapping("/api/wmUser/{apiUserId}")
    public ResultVo<WmUser> findUserById(@PathVariable Long apiUserId);

    /**
     * 远程调用添加wmUser
     * @param wmUser 接收远程调用返回的参数
     * @return 返回添加是否成功的数据
     */
    @PostMapping("/api/wmUser/add")
    public ResultVo<WmUser> addWmUser(@RequestBody WmUser wmUser);
}
